﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VoltGameEditor
{
    public partial class twoDeeDiag : Form
    {
        public twoDeeDiag()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int i = mapDef.GetDocumentIndex();
            TreeNodeEx node = new TreeNodeEx();
            int[] arr = new int[3];

            arr[0] = (int)nud_sides.Value;
            arr[1] = (int)nud_radX.Value;
            arr[2] = (int)nud_radY.Value;

			node.ItemType = MapObject.Type.TwoDeeObj;
            node.Text = "2d Polygon[" + this.nud_sides.Value.ToString() + "]";
            node.ImageIndex = 6;
            node.SelectedImageIndex = 6;
            node.ObjIndex = mapDef.MapData[i].TwoDeeObjects.Count;
            node.Tag = arr;

            mapDef.MapData[i].Tree.Nodes[0].Nodes.Add(node);

            Framework.CreateObject(node);

			functions.InvalidateViewports();

            this.Hide();
        }
    }
}
